package com.example.jnidemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.example.jnidemo.bean.Student;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private TextView textView;
    private JniTest jniTest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView = findViewById(R.id.text);
        jniTest = new JniTest();
        textView.setText(jniTest.jniHelloWorld());
        Log.e("TAG","result:"+jniTest.getStringFormc(10,8));
    }

    private List<Student> initStudents(){
        List<Student> stuList = new ArrayList<>();
        Student student1 = new Student();
        student1.setId(1);
        student1.setName("张三");
        student1.setAge(10);

        Student student2 = new Student();
        student2.setId(2);
        student2.setName("李四");
        student2.setAge(13);

        Student student3 = new Student();
        student3.setId(3);
        student3.setName("王五");
        student3.setAge(12);

        Student student4 = new Student();
        student4.setId(4);
        student4.setName("lao六");
        student4.setAge(13);

        stuList.add(student1);
        stuList.add(student2);
        stuList.add(student3);
        return stuList;
    }
}
